package com.itheima.d09_io_print;

import java.io.FileOutputStream;
import java.io.PrintStream;
import java.io.PrintWriter;
import java.util.Date;

/**
 * 目标：了解打印流的基本使用
 */
public class Test2 {

    public static void main(String[] args) {
        try(
                PrintWriter ps1 = new PrintWriter("day11_io\\src\\com\\itheima\\d09_io_print\\ayu.txt");
                //PrintWriter ps2 = new PrintWriter(new File("day11_io\\src\\com\\itheima\\d09_io_print\\ayu.txt"));
                //PrintWriter ps3 = new PrintWriter(new FileOutputStream("day11_io\\src\\com\\itheima\\d09_io_print\\ayu.txt"));

                //PrintWriter ps1 = new PrintWriter("day11_io\\src\\com\\itheima\\d09_io_print\\ayu.txt", "GBK");
                //PrintWriter ps6 = new PrintWriter(new FileOutputStream("day11_io\\src\\com\\itheima\\d09_io_print\\ayu.txt"), true,"utf-8");
                //PrintWriter ps1 = new PrintWriter(new FileOutputStream("day11_io\\src\\com\\itheima\\d09_io_print\\ayu.txt"), true);
                ){

            //打印数据
            //print 提供丰富打印功能
            ps1.println(666); //打印  + 换行
            ps1.println('男');
            ps1.println(1.68);
            ps1.println(true);
            ps1.println("张三");
            ps1.println(new Date());


            //write 保留打印字节数据的功能
            ps1.write(23445);
            ps1.write('男');
            ps1.write("你好");

        }catch (Exception e){
        }
    }
}
